Public Class regRubro

    Private objG As capaNegocios.Gestor = capaNegocios.Gestor.instanciar

    Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End Sub

    Private Sub CheckBox2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End Sub

    Private Sub regRubro_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub canrub_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles canrub.Click
        Close()
    End Sub

    Private Sub ckextra_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ckextra.CheckedChanged

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 
        Dim rubro As String = TextBox1.Text
        Dim porcentaje As String = TextBox2.Text
        Dim tipo As Boolean = True
        Dim extra As Boolean = False
        If radioGrupal.Checked Then
            tipo = False
        End If
        If ckextra.Checked Then
            extra = True
        End If
        Try
            objG.registrarRubro(rubro, porcentaje, tipo, extra)
            MessageBox.Show("Se registro el Rubro", "Confimacion", MessageBoxButtons.OK, MessageBoxIcon.Information)
        Catch ex As Exception
            MessageBox.Show(ex.Message, "Error en formato", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
            Me.DialogResult = Windows.Forms.DialogResult.None
        End Try
    End Sub

End Class